package com.day02;

public class MyMain {
    public static void main(String args[]) {
        SalairedEmployee salairedEmployee=new SalairedEmployee();
        salairedEmployee.earnings();
    }
}

abstract class Employee {
    private String name;
    private int number;
    private MyDate birthday;

    abstract double earnings();

    @Override
    public String toString() {
        System.out.println("Employee{" +
                "name='" + name + '\'' +
                ", number=" + number +
                ", birthday=" + birthday +
                '}');
        return "Employee{" +
                "name='" + name + '\'' +
                ", number=" + number +
                ", birthday=" + birthday +
                '}';
    }
}

class MyDate {
    private int year;
    private int month;
    private int day;

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public String toDateString() {
        return year + "年" + month + "月" + day + "日";
    }
}

class SalairedEmployee extends Employee {
    private double monthlySalary;

    public double getMonthlySalary() {
        return monthlySalary;
    }

    public void setMonthlySalary(double monthlySalary) {
        this.monthlySalary = monthlySalary;
    }

    @Override
    double earnings() {
        return monthlySalary;
    }

    @Override
    public String toString() {
        System.out.println("SalairedEmployee{" +
                "monthlySalary=" + monthlySalary +
                '}');
        return "SalairedEmployee{" +
                "monthlySalary=" + monthlySalary +
                '}';
    }
}